package com.aspose.cells;

class zvi implements zagr {
   private zafn a;
   private com.aspose.cells.b.a.b.a.zg b = null;
   private zbta c;
   private zacm d;
   private boolean e = false;

   zvi(zafn var1) {
      this.a = var1;
      this.d = new zacm();
      this.c = new zbta();
   }

   com.aspose.cells.b.a.b.a.zg a() {
      return this.b;
   }

   zacm b() {
      return this.d;
   }

   zbta c() {
      return this.c;
   }

   public zagx d() {
      return this.d;
   }

   public zaid e() {
      return this.c;
   }

   public void a(Color var1, Color var2, int var3) {
      this.a.a(5);
      this.b = new com.aspose.cells.b.a.b.a.zg(var3, var1, var2);
   }

   int f() {
      return this.a.h();
   }

   public com.aspose.cells.b.a.b.zc a(com.aspose.cells.b.a.b.a.ze var1, boolean var2, float var3) {
      switch(this.f()) {
      case 3:
         return this.b().a(var1, (com.aspose.cells.b.a.b.zm)null, var2, var3);
      case 4:
         return this.c.a(var1, var3);
      case 5:
         Color var4 = Color.fromArgb(this.b.c().getA() & 255, (int)((float)(this.b.c().getR() & 255) * var3), (int)((float)(this.b.c().getG() & 255) * var3), (int)((float)(this.b.c().getB() & 255) * var3));
         Color var5 = Color.fromArgb(this.b.b().getA() & 255, (int)((float)(this.b.b().getR() & 255) * var3), (int)((float)(this.b.b().getG() & 255) * var3), (int)((float)(this.b.b().getB() & 255) * var3));
         return new com.aspose.cells.b.a.b.a.zg(this.b.d(), var4, var5);
      default:
         return new com.aspose.cells.b.a.b.zu(Color.getWhite());
      }
   }

   public void a(com.aspose.cells.b.a.b.zc var1) {
      switch(this.f()) {
      case 3:
      case 5:
         var1.h();
         break;
      case 4:
         var1.h();
      }

   }

   public boolean a(zvi var1) throws Exception {
      if (var1 == null) {
         return false;
      } else if (this.f() != var1.f()) {
         return false;
      } else if (this.f() == 3) {
         return this.b().a(var1.b());
      } else if (this.f() == 5) {
         if (this.a().d() != var1.a().d()) {
            return false;
         } else if (this.a().b().getA() == var1.a().b().getA() && this.a().b().getR() == var1.a().b().getR() && this.a().b().getG() == var1.a().b().getB() && this.a().b().getB() == var1.a().b().getB()) {
            return this.a().c().getA() == var1.a().c().getA() && this.a().c().getR() == var1.a().c().getR() && this.a().c().getG() == var1.a().c().getB() && this.a().c().getB() == var1.a().c().getB();
         } else {
            return false;
         }
      } else {
         return this.f() == 4 ? this.c().a(var1.c()) : false;
      }
   }

   protected void finalize() throws Exception {
      this.a(false);
   }

   public void g() {
      this.a(true);
      com.aspose.cells.b.a.zg.a(this);
   }

   protected void a(boolean var1) {
      if (!this.e) {
         if (var1 && this.c != null) {
            this.c.r();
         }

         this.e = true;
      }

   }
}
